import request from '@/utils/request'

// 获取组数据列表
export function getGroupData(params) {
  return request({
    url: '/vue-element-admin/group/data',
    method: 'get',
    params
  })
}

// 创建组数据
export function createGroupData(data) {
  return request({
    url: '/vue-element-admin/group/create',
    method: 'post',
    data
  })
}

// 更新组数据
export function updateGroupData(data) {
  return request({
    url: '/vue-element-admin/group/update',
    method: 'post',
    data
  })
}

// 删除组数据
export function deleteGroupData(id) {
  return request({
    url: '/vue-element-admin/group/delete',
    method: 'post',
    data: { id }
  })
}

// 卖出商品
export function sellFruit(data) {
  return request({
    url: '/vue-element-admin/fruit/sell',
    method: 'post',
    data
  })
}

export function submitMaichuRecord(data) {
  return request({
    url: '/vue-element-admin/maichu/record',
    method: 'post',
    data
  })
}

// maichu数据api
export function getMaichuData() {
  return request({
    url: '/vue-element-admin/maichu/data',
    method: 'get'
  })
}

export function updateUser(data) {
  return request({
    url: '/vue-element-admin/user/update',
    method: 'post',
    data
  })
}

export function getUserData() {
  return request({
    url: '/vue-element-admin/user/data',
    method: 'get'
  })
}
